<template>
<div class="front-page common-page" @keyup.enter="searchHandle" >
  <div class="logo">
    <img src="../../public/img/title.png" alt="">
  </div>
  <div class="search-wrap">
    <div class="search-wrap__input">
      <input v-model="input" placeholder="请输入内容" type="text" />
      <!-- <el-input v-model="input" placeholder="请输入内容"></el-input> -->
    </div>
    <div class="search-wrap__btn" @click="searchHandle">
      搜索
    </div>
  </div>
</div>
</template>
<style scoped lang="scss">
@import '../style/_vars.scss';

.front-page{
  min-height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-flow: column;
  align-items: center;
  background: no-repeat;
  background-color: #F8F8F8;
  background-image: url('../../public/img/bg.jpg');
  background-size: auto auto;
  background-position: center top; 
  .logo{
    width: 380px;
    // padding-top: 200px;
    margin: 120px auto 80px auto;
    img{
      display: block;
      width: 100%;
    }
  }
  .search-wrap{
    box-sizing: border-box;
    display: flex;
    width: 46%;
    min-width: 590px;
    max-width: 850px; 
    flex-flow: row nowrap;
    align-items: center;
    &__input{
      flex: 1;
      input{
        display: block;
        width: 100%;
        height: 40px;
        padding-left: 10px;
        border-radius: 0;
        border: 1px solid $--color-primary;
        border-right: 0px solid red;
      }
      /deep/ .el-input__inner{
        border-radius: 0;
        border: 1px solid $--color-primary;
      }
    }
    &__btn{
      flex: 0 0 100px;
      height: 100%;
      line-height: 40px;
      text-align:center;
      color: white;
      vertical-align: center;
      background: $--color-primary;
      cursor: pointer;
    }
  }
}  

</style>

<script>
export default {
  name: 'IndexPage',
  components: {
  },
  data() {
    return {
      input: '',
      input2: ''
    }
  },
  methods: {
    searchHandle() {
      if (!this.input) return
      let encodeKw = encodeURIComponent(this.input)
      this.$router.push({
        'path': `/result/${encodeKw}`
      })
    }
  }
}
</script>


